# 检测摄像头
from multiprocessing import Process
from py.uitls.capture import Device


def get_pic(pic_name):
    cam0 = Device(0)
    image = cam0.get_image(2)
    # 然后再保存文件
    image.save(pic_name)
    return pic_name


def get_pic_join(pic_name):
    process = Process(target=get_pic, args=(pic_name,))
    process.start()
    process.join()

def get_pic_join(pic_name):
    process = Process(target=get_pic, args=(pic_name,))
    process.start()
    process.join()
